package com.nhh.v.service

import java.{util ⇒ jul}

import com.nhh.v.mapper.{NhhwakHashrateDetailsMapper, NhhwakHashrateRankingMapper}
import com.nhh.v.model.{NhhwakHashrateDetails, NhhwakHashrateRanking}
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
  * Created by ywp on 2018/9/6.
  */
@Service
class HashRateService(@Autowired val nhhwakHashrateDetailsMapper: NhhwakHashrateDetailsMapper,
                      @Autowired val nhhwakHashrateRankingMapper: NhhwakHashrateRankingMapper) extends BaseService {


  def getUserHashRateList(userId: Int): jul.List[NhhwakHashrateDetails] = {
    nhhwakHashrateDetailsMapper.getUserHashRateList(userId)
  }

  def qryHashRateRank(userId: Int, pIndex: String, pSize: String): jul.List[NhhwakHashrateRanking] = {
    startPage(pIndex.toInt, pSize.toInt, DEFAULT_COUNT)
    nhhwakHashrateRankingMapper.qryHashRateRank(userId)
  }

}
